<?php
/**
 * 
 * Helper for creating a list of location elements with
 * links
 * 
 * @category Abovo
 * 
 * @package Abovo_View
 * 
 * @author Antti Holvikari <anttih@gmail.com>
 * 
 */

/**
 * 
 * Helper for creating a list of location elements with
 * links
 * 
 * @category Abovo
 * 
 * @package Abovo_View
 * 
 */
class Abovo_View_Helper_Location extends Solar_View_Helper {
    
    /**
     * 
     * Created a list of location elements with links
     * 
     * @param array $elements Element list
     * 
     * @return array
     * 
     */
    public function location($elements)
    {
        foreach ($elements as $one) {
            if (! empty($one[1])) {
                $parts[] = $this->_view->action($one[1], $one[0]);
            } else {
                $parts[] = $this->_view->escape($one[0]);
            }
        }
        
        return $parts;
    }
}
